package b.r;

import android.animation.Animator;
import android.view.View;
import android.view.ViewGroup;
import androidx.transition.Transition;
import androidx.transition.Transition.d;
import androidx.transition.Visibility;
import java.util.ArrayList;

/* compiled from: Visibility */
public class t extends f {
    public final /* synthetic */ ViewGroup a;
    public final /* synthetic */ View b;
    public final /* synthetic */ View c;
    public final /* synthetic */ Visibility d;

    public t(Visibility visibility, ViewGroup viewGroup, View view, View view2) {
        this.d = visibility;
        this.a = viewGroup;
        this.b = view;
        this.c = view2;
    }

    public void c(Transition transition) {
        this.a.getOverlay().remove(this.b);
    }

    public void d(Transition transition) {
        if (this.b.getParent() == null) {
            this.a.getOverlay().add(this.b);
            return;
        }
        Visibility visibility = this.d;
        int size = visibility.m.size();
        while (true) {
            size--;
            if (size < 0) {
                break;
            }
            ((Animator) visibility.m.get(size)).cancel();
        }
        ArrayList arrayList = visibility.q;
        if (arrayList != null && arrayList.size() > 0) {
            arrayList = (ArrayList) visibility.q.clone();
            int size2 = arrayList.size();
            for (int i = 0; i < size2; i++) {
                ((d) arrayList.get(i)).b(visibility);
            }
        }
    }

    public void e(Transition transition) {
        this.c.setTag(2131296851, null);
        this.a.getOverlay().remove(this.b);
        transition.w(this);
    }
}
